package app;

class NumericAttribute extends Attribute {
	private double minValue, maxValue;
	
	public NumericAttribute() {
		this.type = AttributeType.NUMERIC;
		this.minValue = this.maxValue = Double.NaN;
	}
	
	public NumericAttribute(String name) {
		this();
		this.name = name;
	}
	
	public double getMinValue() {
		return this.minValue;
	}
	
	public double getMaxValue() {
		return this.maxValue;
	}
	
	public void addValue(double value) {
		if(minValue == Double.NaN) {
			minValue = maxValue = value;
		} else if(minValue > value) {
			minValue = value;
		} else if(maxValue < value) {
			maxValue = value;
		}
	}
}